using Boo.Lang;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;

[Serializable]
public class weightdisk : MonoBehaviour
{
	[Serializable]
	[CompilerGenerated]
	internal sealed class _0024find_0024497 : GenericGenerator<WaitForSeconds>
	{
		internal weightdisk _0024self__0024499;

		public _0024find_0024497(weightdisk self_)
		{
			_0024self__0024499 = self_;
		}

		public override IEnumerator<WaitForSeconds> GetEnumerator()
		{
			return new _0024(_0024self__0024499);
		}
	}

	public bool leftarrow;

	public AudioClip clip;

	public ddload ddload;

	public GameObject bsdisk;

	public GameObject bkdisk;

	public GameObject dcsdisk;

	public GameObject dgsdisk;

	public GameObject dfdisk;

	public GameObject kddisk;

	public GameObject mddisk;

	public GameObject wbdisk;

	public GameObject tgdisk;

	public GameObject fldisk;

	public GameObject abdisk;

	public GameObject btdisk;

	public GameObject sbdisk;

	public int state;

	public Texture pressed;

	public Texture unpressed;

	public GUITexture gui;

	public weightdisk()
	{
		state = 1;
	}

	public void Start()
	{
		gui = gameObject.GetComponent<GUITexture>();
		StartCoroutine(find());
	}

	public void Update()
	{
		if ((bool)ddload)
		{
			ddload.diskstate = state;
		}
		if (state < 1)
		{
			state = 5;
			change();
		}
		if (state == 6)
		{
			state = 1;
			change();
		}
		if (state == 13)
		{
			state = 1;
			change();
		}
		if (UnityEngine.Input.touchCount == 0)
		{
			gui.texture = unpressed;
		}
		if (UnityEngine.Input.touchCount <= 0)
		{
			return;
		}
		Touch touch = Input.touches[0];
		if (touch.phase != 0 || !GetComponent<GUITexture>().HitTest(touch.position))
		{
			return;
		}
		leftarrow = false;
		AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
		gui.texture = pressed;
		state++;
		change();
		ddload.diskstate = state;
		if (state == 1)
		{
			if (PlayerPrefs.GetInt("Disk1") == 0)
			{
				state = 2;
			}
			if (PlayerPrefs.GetInt("Disk1") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 1);
				bsdisk.active = false;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = false;
				dfdisk.active = false;
				kddisk.active = true;
				mddisk.active = false;
				wbdisk.active = false;
				fldisk.active = false;
				abdisk.active = false;
				btdisk.active = false;
				sbdisk.active = false;
			}
		}
		if (state == 2)
		{
			if (PlayerPrefs.GetInt("Disk2") == 0)
			{
				state = 3;
			}
			if (PlayerPrefs.GetInt("Disk2") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 2);
				bsdisk.active = true;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = false;
				dfdisk.active = false;
				kddisk.active = false;
				mddisk.active = false;
				wbdisk.active = false;
				tgdisk.active = false;
				fldisk.active = false;
				abdisk.active = false;
				btdisk.active = false;
				sbdisk.active = false;
			}
		}
		if (state == 3)
		{
			if (PlayerPrefs.GetInt("Disk3") == 0)
			{
				state = 4;
			}
			if (PlayerPrefs.GetInt("Disk3") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 3);
				bsdisk.active = false;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = true;
				dfdisk.active = false;
				kddisk.active = false;
				mddisk.active = false;
				wbdisk.active = false;
				tgdisk.active = false;
				fldisk.active = false;
				abdisk.active = false;
				btdisk.active = false;
				sbdisk.active = false;
			}
		}
		if (state == 4)
		{
			if (PlayerPrefs.GetInt("Disk4") == 0)
			{
				state = 5;
			}
			if (PlayerPrefs.GetInt("Disk4") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 4);
				bsdisk.active = false;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = false;
				dfdisk.active = false;
				kddisk.active = false;
				mddisk.active = false;
				wbdisk.active = false;
				tgdisk.active = false;
				fldisk.active = true;
				abdisk.active = false;
				btdisk.active = false;
				sbdisk.active = false;
			}
		}
		if (state == 5)
		{
			if (PlayerPrefs.GetInt("Disk5") == 0)
			{
				state = 1;
			}
			if (PlayerPrefs.GetInt("Disk5") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 5);
				bsdisk.active = false;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = false;
				dfdisk.active = false;
				kddisk.active = false;
				mddisk.active = false;
				wbdisk.active = false;
				tgdisk.active = false;
				fldisk.active = false;
				abdisk.active = false;
				btdisk.active = true;
				sbdisk.active = false;
			}
		}
	}

	public void change()
	{
		if (!leftarrow)
		{
			if (state == 1)
			{
				if (PlayerPrefs.GetInt("Disk1") == 0)
				{
					state = 2;
				}
				if (PlayerPrefs.GetInt("Disk1") == 1)
				{
					PlayerPrefs.SetInt("DiskState", 1);
					bsdisk.active = false;
					bkdisk.active = false;
					dcsdisk.active = false;
					dgsdisk.active = false;
					dfdisk.active = false;
					kddisk.active = true;
					mddisk.active = false;
					wbdisk.active = false;
					fldisk.active = false;
					abdisk.active = false;
					btdisk.active = false;
					sbdisk.active = false;
				}
			}
			if (state == 2)
			{
				if (PlayerPrefs.GetInt("Disk2") == 0)
				{
					state = 3;
				}
				if (PlayerPrefs.GetInt("Disk2") == 1)
				{
					PlayerPrefs.SetInt("DiskState", 2);
					bsdisk.active = true;
					bkdisk.active = false;
					dcsdisk.active = false;
					dgsdisk.active = false;
					dfdisk.active = false;
					kddisk.active = false;
					mddisk.active = false;
					wbdisk.active = false;
					tgdisk.active = false;
					fldisk.active = false;
					abdisk.active = false;
					btdisk.active = false;
					sbdisk.active = false;
				}
			}
			if (state == 3)
			{
				if (PlayerPrefs.GetInt("Disk3") == 0)
				{
					state = 4;
				}
				if (PlayerPrefs.GetInt("Disk3") == 1)
				{
					PlayerPrefs.SetInt("DiskState", 3);
					bsdisk.active = false;
					bkdisk.active = false;
					dcsdisk.active = false;
					dgsdisk.active = true;
					dfdisk.active = false;
					kddisk.active = false;
					mddisk.active = false;
					wbdisk.active = false;
					tgdisk.active = false;
					fldisk.active = false;
					abdisk.active = false;
					btdisk.active = false;
					sbdisk.active = false;
				}
			}
			if (state == 4)
			{
				if (PlayerPrefs.GetInt("Disk4") == 0)
				{
					state = 5;
				}
				if (PlayerPrefs.GetInt("Disk4") == 1)
				{
					PlayerPrefs.SetInt("DiskState", 4);
					bsdisk.active = false;
					bkdisk.active = false;
					dcsdisk.active = false;
					dgsdisk.active = false;
					dfdisk.active = false;
					kddisk.active = false;
					mddisk.active = false;
					wbdisk.active = false;
					tgdisk.active = false;
					fldisk.active = true;
					abdisk.active = false;
					btdisk.active = false;
					sbdisk.active = false;
				}
			}
			if (state == 5)
			{
				if (PlayerPrefs.GetInt("Disk5") == 0)
				{
					state = 1;
				}
				if (PlayerPrefs.GetInt("Disk5") == 1)
				{
					PlayerPrefs.SetInt("DiskState", 5);
					bsdisk.active = false;
					bkdisk.active = false;
					dcsdisk.active = false;
					dgsdisk.active = false;
					dfdisk.active = false;
					kddisk.active = false;
					mddisk.active = false;
					wbdisk.active = false;
					tgdisk.active = false;
					fldisk.active = false;
					abdisk.active = false;
					btdisk.active = true;
					sbdisk.active = false;
				}
			}
		}
		if (!leftarrow)
		{
			return;
		}
		if (state == 1)
		{
			if (PlayerPrefs.GetInt("Disk1") == 0)
			{
				state = 5;
			}
			if (PlayerPrefs.GetInt("Disk1") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 1);
				bsdisk.active = false;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = false;
				dfdisk.active = false;
				kddisk.active = true;
				mddisk.active = false;
				wbdisk.active = false;
				fldisk.active = false;
				abdisk.active = false;
				btdisk.active = false;
				sbdisk.active = false;
			}
		}
		if (state == 2)
		{
			if (PlayerPrefs.GetInt("Disk2") == 0)
			{
				state = 1;
			}
			if (PlayerPrefs.GetInt("Disk2") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 2);
				bsdisk.active = true;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = false;
				dfdisk.active = false;
				kddisk.active = false;
				mddisk.active = false;
				wbdisk.active = false;
				tgdisk.active = false;
				fldisk.active = false;
				abdisk.active = false;
				btdisk.active = false;
				sbdisk.active = false;
			}
		}
		if (state == 3)
		{
			if (PlayerPrefs.GetInt("Disk3") == 0)
			{
				state = 2;
			}
			if (PlayerPrefs.GetInt("Disk3") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 3);
				bsdisk.active = false;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = true;
				dfdisk.active = false;
				kddisk.active = false;
				mddisk.active = false;
				wbdisk.active = false;
				tgdisk.active = false;
				fldisk.active = false;
				abdisk.active = false;
				btdisk.active = false;
				sbdisk.active = false;
			}
		}
		if (state == 4)
		{
			if (PlayerPrefs.GetInt("Disk4") == 0)
			{
				state = 3;
			}
			if (PlayerPrefs.GetInt("Disk4") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 4);
				bsdisk.active = false;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = false;
				dfdisk.active = false;
				kddisk.active = false;
				mddisk.active = false;
				wbdisk.active = false;
				tgdisk.active = false;
				fldisk.active = true;
				abdisk.active = false;
				btdisk.active = false;
				sbdisk.active = false;
			}
		}
		if (state == 5)
		{
			if (PlayerPrefs.GetInt("Disk5") == 0)
			{
				state = 4;
			}
			if (PlayerPrefs.GetInt("Disk5") == 1)
			{
				PlayerPrefs.SetInt("DiskState", 5);
				bsdisk.active = false;
				bkdisk.active = false;
				dcsdisk.active = false;
				dgsdisk.active = false;
				dfdisk.active = false;
				kddisk.active = false;
				mddisk.active = false;
				wbdisk.active = false;
				tgdisk.active = false;
				fldisk.active = false;
				abdisk.active = false;
				btdisk.active = true;
				sbdisk.active = false;
			}
		}
	}

	public IEnumerator find()
	{
		return new _0024find_0024497(this).GetEnumerator();
	}

	public void Main()
	{
	}
}
